<div xmlns:th="http://www.thymeleaf.org">
    <div class="card-body" th:if="${pageInfo != null && pageInfo.list.size() != 0}">
        <form action="/payroll/update" method="post" id="crewListForm">
            <input type="text" style="display: none;" id="crewPoTotalMoney" th:name="totalMoney"
                   th:value="${crewPoTotalMoney}">
            <input type="hidden" name="id" th:value="${poId}">
            <input type="hidden" name="code" th:value="${poCode}">
            <input th:if="${auditStatus == null || auditStatus == 12 || auditStatus == 8 || auditStatus == 15}"
                   type="hidden" th:name="auditStatus" id="auditStatus" th:value="${auditStatus}">
            <div th:if="${str == 'detail' || auditStatus == 12}" class="form-group">
                <label for="testrange"> 审核意见:&nbsp;&nbsp; </label>
                <textarea class="form-control" rows="5" cols="105" name="auditOpinion"
                          th:text="${auditOpinion}"></textarea>
                <small class="form-text text-muted"></small>
            </div>
            <table class="table table-striped mt-3">
                <thead>
                <tr>
                    <th scope="col">档案编码</th>
                    <th scope="col">姓名</th>
                    <th scope="col" th:each="name:${headSet}" th:text="${name}"></th>
                    <th scope="col">应扣金额</th>
                    <th scope="col">总额</th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="map,iterStat:${pageInfo.list}" th:inline="text">
                    <td>
                        <input type="hidden" th:name="|crewList[${iterStat.index}].id|" th:value="${map.id}">
                        [[${map.aCode}]]
                    </td>
                    <td>[[${map.aName}]]</td>
                    <td th:name="proMoney_td" th:each="detail,iterStat1:${map.detailMap}">
                        <input type="hidden" th:name="|crewList[${iterStat.index}].detailList[${iterStat1.index}].id|"
                               th:value="${detail.id}">
                        <input type="number"
                               th:name="|crewList[${iterStat.index}].detailList[${iterStat1.index}].proMoney|"
                               th:value="${detail.proMoney}" min="0" th:onblur="crewTotalMoney(this)">
                    </td>
                    <td>
                        <input type="number" th:name="|crewList[${iterStat.index}].dockPay|"
                               th:value="${map.dockPay}" max="0" th:onblur="dockPayBlur(this)">
                    </td>
                    <td th:name="crewTotalMoney">
                        <input th:name="|crewList[${iterStat.index}].totalMoney|"
                               th:value="${map.crewTotalMoney}" readonly="readonly">
                    </td>
                </tr>
                </tbody>
            </table>
            <div th:if="${str != 'detail'}" class="form-group" style="text-align: center;">
                <input th:if="${auditStatus == null || auditStatus == 8 || auditStatus == 15}"
                       type="button" class="btn btn-success" value="保存"
                       th:onclick="|setAuditStatus(8, ${pageInfo.pageNum})|">&emsp;
                <input th:if="${auditStatus == null || auditStatus == 8 || auditStatus == 15}"
                       type="button" class="btn btn-success" value="提交审核"
                       th:onclick="|setAuditStatus(12, ${pageInfo.pageNum})|">
                <input th:if="${auditStatus == 12}" type="button" class="btn btn-success" value="审核通过"
                       th:onclick="|setAuditStatus(11, ${pageInfo.pageNum})|">&emsp;
                <input th:if="${auditStatus == 12}" type="button" class="btn btn-success" value="驳回"
                       th:onclick="|setAuditStatus(15, ${pageInfo.pageNum})|">&emsp;
                <input type="button" class="btn btn-danger" value="重置" onclick="setPoTotalMoney();">&emsp;
                <input type="button"
                       class="btn btn-danger" value="返回"
                       onclick="javascript:window.history.back();">
            </div>
            <div th:if="${str == 'detail'}" class="form-group" style="text-align: center;">
                <button class="btn btn-danger" onclick="javascript:window.history.back();">返回</button>
            </div>
        </form>
        <div th:replace="common/comm :: #page"></div>
        <script th:inline="javascript">
            jQuery.noConflict(); // 让渡 $ 的使用权
            (function ($) {
                var str = [[${str}]];
                if (str == "detail") {
                    $("#crewListForm").find("input,textarea").attr("disabled", "true");
                    //$("#crewListForm").find("textarea").attr("disabled", "true");
                }
            })(jQuery);
        </script>
    </div>
    <div th:if="${pageInfo == null || pageInfo.list.size() == 0}">
        暂时没有记录.....
        <input type="button"
               class="btn btn-danger" value="返回"
               onclick="javascript:window.history.back();">
    </div>
</div>